#include<stdlib.h>
#include<stdio.h>
void CopyFile(const  char*curpath,const char* destpath)
{
    File *fr=fopen(curpath,"r");
    if(!fr)
    {
        std::cout<<"文件读取失败\n";
        return;
    }
    File *fw=fopen(destpath,"w");
    if(!fw)
    {
        std::cout<<"文件写入失败\n";
        return;
    }
    fseek(fr,0,SEEK_END);
    long size=ftell(fr);
    fseek(fr,0,SEEK_SET);
    char chunk[4096]={0};
    long readsize=0;
    while(readsize<size)
    {
        long truesize=size-readsize>4096?4096:size-readsize;
        fread(chunk,truesize,1,fr);
        fwrite(chunk,truesize,1,fw);
        readsize+=truesize;
    }
    fclose(fr);
    fclose(fw);
}